import request from '@/utils/request2'

export function getRoutes() {
  return request({
    url: '/routes',
    method: 'get'
  })
}

// 添加
export function createTrainNew(temp) {
  return request({
    url: '/ehs-train-new/add',
    method: 'post',
    baseURL: process.env.VUE_APP_BASE_API2,
    params: temp
  })
}
// 列表
export function fetchTrainNewList(query) {
  return request({
    url: '/ehs-train-new/list',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2,
    params: query
  })
}
// 查询列表
export function getTrainNewlist(query) {
  return request({
    url: '/ehs-train-new/getTrainNewlist',
    method: 'get',
    params: query
  })
}
// 获取明细
export function getTrainNew() {
  return request({
    url: '/ehs-train-new/detail',
    method: 'get'
  })
}

// 添加
export function addTrainNew(data) {
  return request({
    url: '/ehs-train-new/add',
    method: 'post',
    data
  })
}

// 伪删除
export function deleteTrainNew(id) {
  return request({
    url: '/ehs-train-new/delete',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2,
    params: { id }
  })
}

// 修改页面
export function editTrainNewPage(id) {
  return request({
    url: '/ehs-train-new/edit',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2,
    params: { id }
  })
}
// 修改
export function editTrainNew(query) {
  return request({
    url: '/ehs-train-new/edit',
    method: 'post',
    baseURL: process.env.VUE_APP_BASE_API2,
    params: query
  })
}
// 查询总数量
export function fetchAllCount() {
  return request({
    url: '/ehs-train-new/count',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2
  })
}

// 获取人员列表
export function getPersonList() {
  return request({
    url: '/ehs-train-new/personlist',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2

  })
}

// 获取部门列表
export function getDeptList() {
  return request({
    url: '/ehs-train-new/deptlist',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2

  })
}

// 总列表
export function getlistAll(query) {
  return request({
    url: '/ehs-train-new/listAll',
    method: 'get',
    params: query
  })
}
// 总明细
export function getdetailAll(query) {
  return request({
    url: '/ehs-train-new/detailAll',
    method: 'get',
    params: query
  })
}

